#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read() {
    int f=0,t=0;
    char c=getchar();
    while(!isdigit(c)) t|=(c=='-'),c=getchar();
    while(isdigit(c)) f=(f<<3)+(f<<1)+c-48,c=getchar();
    return t?-f:f;
}
void write(int x) {
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar('0'+x%10);
}
int ans[200005],top;
struct f{int l,r;}a[100005];
string s,t;
int dpp[100005][25];
void bl(int n,int m){
	dpp[0][0]=0;
	for(int i=0;i<=n;i++){for(int j=0;j<=m;j++) dpp[i][j]=-1;}
	
	for(int i=1;i<=m;i++){
		int ma=0,sum=0;
		for(int j=1;j<=n;j++){
			if(j-1>ma){if(s[j-1]!=s[ma+1]) break;}
			if(s[j]==t[i]){dpp[j][i]=ma;}
			if(dpp[j][i-1]!=-1) ma=j;
		}
	}
	
	while(s[n]!=t[m]&&n>0){n--;}
	if(dpp[n][m]!=-1){
		int pd=n;
		cout<<"YES"<<'\n';
		while(m){ans[++top]=pd;pd=dpp[pd][m];m--;}
		sort(ans+1,ans+1+top);
		for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');
		exit(0);
	}
	if(n==0){cout<<"NO";exit(0);}
	for(int i=n-1;i>=1;i--){
		if(s[i]!=s[i+1]) break;
		if(dpp[i][m]!=-1){
			int pd=i;
			cout<<"YES"<<'\n';
			while(m){ans[++top]=pd;pd=dpp[pd][m];m--;}
			sort(ans+1,ans+1+top);
			for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');
			exit(0);
		}
	}
	cout<<"NO";exit(0);
}
int dp[2005][2005];
signed main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin>>s>>t;
	
//	cout<<s<<"\n"<<t<<'\n';
	
	int n=s.size(),m=t.size(),pd=0;
	s=' '+s,t=' '+t;
	for(int i=1;i<m;i++){if(t[i]==t[i+1])pd=1;}
	if(pd==0){
		if(s[1]==t[1]){
			for(int i=2;i<=n;i++){
				if(s[i]!=s[i-1]){
					ans[++top]=i-1;
				}
			}
			if(s[n]==t[m])ans[++top]=n;
			if(top!=m) return cout<<"NO",0;
			else{cout<<"YES"<<'\n';for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');}
		}
		else{
			for(int i=2;i<=n;i++){if(s[i]!=s[i-1]) ans[++top]=i;}
			if(top!=m) return cout<<"NO",0;
			else{cout<<"YES"<<'\n';for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');}
		}
		return 0;
	}
	if(n<=100000&&m<=20){bl(n,m);return 0;}
	for(int i=0;i<=n;i++){for(int j=0;j<=m;j++) dp[i][j]=-1;}
	dp[0][0]=0;
	
	for(int i=1;i<=m;i++){
		int ma=0,sum=0;
		for(int j=1;j<=n;j++){
			if(j-1>ma){if(s[j-1]!=s[ma+1]) break;}
			if(s[j]==t[i]){dp[j][i]=ma;}
			if(dp[j][i-1]!=-1) ma=j;
		}
	}
	
	while(s[n]!=t[m]&&n>0){n--;}
	if(dp[n][m]!=-1){
		int pd=n;
		cout<<"YES"<<'\n';
		while(m){ans[++top]=pd;pd=dp[pd][m];m--;}
		sort(ans+1,ans+1+top);
		for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');
		return 0;
	}
	if(n==0) return cout<<"NO",0;
	for(int i=n-1;i>=1;i--){
		if(s[i]!=s[i+1]) break;
		if(dp[i][m]!=-1){
			int pd=i;
			cout<<"YES"<<'\n';
			while(m){ans[++top]=pd;pd=dp[pd][m];m--;}
			sort(ans+1,ans+1+top);
			for(int i=1;i<=top;i++) write(ans[i]),putchar(' ');
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}
